﻿// Type: NUnit.Framework.TestFixtureAttribute
// Assembly: nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
// Assembly location: D:\SkillUp\Patterns\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll

using System;
using System.Collections;

namespace NUnit.Framework
{
  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
  public class TestFixtureAttribute : Attribute
  {
    private string description;
    private object[] arguments;
    private bool isIgnored;
    private string ignoreReason;
    private string category;
    private Type[] typeArgs;
    private bool argsSeparated;

    public string Description
    {
      get
      {
        return this.description;
      }
      set
      {
        this.description = value;
      }
    }

    public string Category
    {
      get
      {
        return this.category;
      }
      set
      {
        this.category = value;
      }
    }

    public IList Categories
    {
      get
      {
        string[] strArray;
        if (this.category != null)
          strArray = this.category.Split(new char[1]
          {
            ','
          });
        else
          strArray = (string[]) null;
        return (IList) strArray;
      }
    }

    public object[] Arguments
    {
      get
      {
        if (!this.argsSeparated)
          this.SeparateArgs();
        return this.arguments;
      }
    }

    public bool Ignore
    {
      get
      {
        return this.isIgnored;
      }
      set
      {
        this.isIgnored = value;
      }
    }

    public string IgnoreReason
    {
      get
      {
        return this.ignoreReason;
      }
      set
      {
        this.ignoreReason = value;
        this.isIgnored = this.ignoreReason != null && this.ignoreReason != string.Empty;
      }
    }

    public Type[] TypeArgs
    {
      get
      {
        if (!this.argsSeparated)
          this.SeparateArgs();
        return this.typeArgs;
      }
      set
      {
        this.typeArgs = value;
        this.argsSeparated = true;
      }
    }

    public TestFixtureAttribute()
      : this((object[]) null)
    {
    }

    public TestFixtureAttribute(params object[] arguments)
    {
      this.arguments = arguments == null ? new object[0] : arguments;
      for (int index = 0; index < this.arguments.Length; ++index)
      {
        if (arguments[index] is SpecialValue && (SpecialValue) arguments[index] == SpecialValue.Null)
          arguments[index] = (object) null;
      }
    }

    private void SeparateArgs()
    {
      int length = 0;
      if (this.arguments != null)
      {
        object[] objArray1 = this.arguments;
        for (int index = 0; index < objArray1.Length && objArray1[index] is Type; ++index)
          ++length;
        this.typeArgs = new Type[length];
        for (int index = 0; index < length; ++index)
          this.typeArgs[index] = (Type) this.arguments[index];
        if (length > 0)
        {
          object[] objArray2 = new object[this.arguments.Length - length];
          for (int index = 0; index < objArray2.Length; ++index)
            objArray2[index] = this.arguments[length + index];
          this.arguments = objArray2;
        }
      }
      else
        this.typeArgs = new Type[0];
      this.argsSeparated = true;
    }
  }
}
